Method for light flicker analysis and device thereof

ABSTRACT

This invention provides devices and methods of determining flicker-related parameters of a light emitting source. In one embodiment, the method has the following steps: a) acquiring one or more photo images or video images of a light emitting source with an image capturing device that has a rolling shutter; b) generating, with a processor, from the photo images or video images a flicker frame having one or more flicker dark lines, wherein each flicker dark lines has an output column value of 1; and c) generating, with a processor, one or more flicker-related parameters based on the flicker frame, thereby determining the flicker-related parameters of the light emitting source.

This application claims the benefit of U.S. 61/972,429 filed Mar. 31,2014. The entire disclosure of the preceding application is herebyincorporated by reference into this application.

FIELD OF THE INVENTION

The present invention relates generally to the field of imageprocessing. In one embodiment, there is provided methods for measuringflicker-related parameters of a light emitting source using imagecapturing apparatus in mobile devices.

BACKGROUND OF THE INVENTION

To save energy, the global trend of lighting equipment is transitioningfrom traditional incandescent light bulbs to compact fluorescent lamps(CFLs) and Light Emitting Diode lamps (LEDs). To produce the same amountof light intensity, CFLs and LEDs can save 70% to 90% of energy thanincandescent light bulbs. This is why governments around the world havepassed regulations or measures to ban or stop the manufacture,importation or sale of incandescent light bulbs in order to phase outthe old generation of lighting equipment and switch to a moreenergy-effective generation like CFLs and LEDs. However, most CFLscontain mercury, which is toxic and harmful to health and also harmfulto the environment if it is not disposed properly. LEDs do not containmercury but raise other health concern.

According to the paper “LED Lighting Flicker and Potential HealthConcerns: IEEE Standard PAR1789 Update”, LED lighting produces flickerwhich is a rapid and repeated change over time in the brightness oflight. Immediate result of a few seconds' exposure to visible flicker(low flicker frequency) can trigger epileptic seizures (even toindividuals with no previous history or diagnosis of epilepsy) whilelong-term exposure to invisible flicker (high flicker frequency) wouldcause adverse health effects like malaise, headaches and impaired visualperformance. As LED bulbs with different levels of flicker will causedifferent harmful effects to people, the flicker properties of LED wouldbe a consumer's selection criteria other than the price.

In the literature, flicker percentage, flicker index and flickerfrequency are the metrics used to describe how severe the flicker is.However, such information is often not available on the light bulbpackage while measuring these values needs professional equipment in thelaboratory. Nevertheless, general consumers actually do not need to knowthe exact values of the flicker properties. In fact, consumers would beable to make a choice if they know Light Bulb A is at flicker level 1which is the safest level to health while Light Bulb E is at flickerlevel 5 which will lead to serious harmful health effects, or if theyknow both Light Bulb B and Light Bulb C are at flicker level 3 but LightBulb B is having less flickering than Light Bulb C. It is one objectiveof the present invention that consumers will be able to use their handymobile phones to take videos of light bulbs and obtain such comparisons.

Due to the changing trend of lighting equipment, the health concern overthe flicker problem and the lack of available information of flickerpercentage, flicker index and flicker frequencies, there is a need forsuch a handy mobile application for consumer to check the bulbs beforethey make a purchase. There is a need to better inform the consumer. Ifconsumers can make a better choice, they can avoid potential harmfuleffects to their health like epileptic seizures, malaise, headaches,impaired visual performance, etc., which in turn would improve students'learning quality and improve people's productivity. Hence, not only thehealth of the public but also the economy and the society would bebenefited.

In industrial settings, when companies attend lighting equipment expo tolook for new products or when companies receive products from themanufacturers, they always want to check whether the products aremeeting the standard or acceptable. In these situations, the industrywould require a mobile solution as a kind of handy preliminary qualityscreening. It is thus another objective of the present invention toprovide such a mobile solution as a kind of handy preliminary qualityscreening of flickering light products.

Citation or identification of any reference in this section or any othersection of this application shall not be construed as an admission thatsuch reference is available as prior art for the present application.

SUMMARY OF THE INVENTION

Accordingly, it is an object of the present invention to provide amethod of measuring the flickers of light emitting sources using imagecapturing apparatus in mobile devices. In one embodiment, the presentinvention relates to a method of measuring the flickers of lightemitting sources using image capturing apparatus in mobile devices forquality checking and quality control of said light emitting sources. Inone embodiment of the present invention, there is provided methodologiesand algorithms to estimate metrics like the percent flicker, the orderof flicker index and the order of flicker frequency through analysingphotos and/or videos of a light emitting source.

In one embodiment of the present invention, there is provided a methodand an apparatus for measuring the flickers of light emitting sourcescomprising the use of at least one image capturing apparatus in mobiledevices. There is provided methodologies and algorithms in said mobiledevices to analyze the flickers in one or more captured photos and inone or more captured videos, wherein further said methodologies andalgorithms estimate metrics comprising the percent flicker, the order offlicker index and the order of flicker frequency of said light emittingsources.

In one embodiment of the present invention, there is provided a methodof using mobile devices such as smartphones, tablets, laptops, notebooksand computer devices with at least one image capturing apparatus.

In one embodiment of the present invention, there is provided a methodof using at least one image capturing apparatus comprising at least onestill photography camera and at least one video camera, or at least onecamera that can capture both still photography and video.

In one embodiment of the present invention, there is provided a methodand an apparatus wherein said methodologies and algorithms comprisemodules of Noise Filter, Flicker Identifier, Flicker Analyzer andDatabase.

In one embodiment, there is provided a method and an apparatus whereinafter capturing one or more video, said one or more video is passed tothe Noise Filter to eliminate motion noise and background noise and toproduce a Flicker Frame, wherein further the Flicker Analyzer willanalyze the flickers from the Flicker Frame and compute metricsestimations such as percent flicker, order of flicker index and order offlicker frequency, wherein such metrics estimations are recorded in aDatabase for reference or comparison.

In another embodiment, there is provided a method and an apparatuswherein after capturing one or more photo the Flicker Identifier willcompute a Flicker Frame from said one or more photo, the Flicker Framewill then be passed to the Flicker Analyzer, wherein further the FlickerAnalyzer will analyze the flickers from the Flicker Frame and computemetrics estimations such as percent flicker, order of flicker index andorder of flicker frequency, wherein such metrics estimations arerecorded in the Database for reference or comparison.

In another embodiment, there is provided a method and an apparatuswherein said method is implemented in hardware.

In yet another embodiment, there is provided a method and an apparatuswherein said method is implemented in software.

Those skilled in the art will appreciate that the invention describedherein is susceptible to variations and modifications other than thosespecifically described.

The present invention includes all such variation and modifications. Theinvention also includes all of the steps and features referred to orindicated in the specification, individually or collectively, and anyand all combinations or any two or more of the steps or features.

In one embodiment, this invention provides a method of determiningflicker-related parameters of a light emitting source, comprising thesteps of: a) acquiring one or more photo images or video images of alight emitting source with an image capturing device that comprisesrolling shutter; b) generating, with a processor, from said photo imagesor video images a flicker frame comprising one or more flicker darklines, wherein each flicker dark lines has an output column value of 1;and c) generating, with a processor, one or more flicker-relatedparameters based on said flicker frame, thereby determining theflicker-related parameters of said light emitting source.

In one embodiment, said flicker-related parameters are selected from thegroup consisting of percent flicker, order of flicker frequency, andorder of flicker index.

In one embodiment, said flicker frame is produced from said video imagesby the steps comprising: a) determining the sum of the differences inpixel values between corresponding pixels in successive frames of thevideo image, wherein any two successive frames, a first frame and asecond frame, that have the smallest difference are the frames that havethe least motion noise; b) subtracting the pixel value of each pixel onsaid first frame from the pixel value of the corresponding pixel on saidsecond frame to obtain changes in pixel values over time; c) assigning acolumn output value of “1” to each column of pixels in said video imagewherein in each of said column, the number of pixels having decreasedpixel value over time is more than the sum of the number of pixelshaving increased pixel value over time; d) assigning a column outputvalue of “0” to each columns of pixels in said video image wherein ineach of said column, the number of pixels having decreased pixel valueover time is not more than the sum of the number of pixels havingincreased pixel value over time and the number of pixels having nochange in pixel value over time; and e) assembling a flicker frame bydrawing each of said column of pixels where its column output value is“1” in the order each corresponding column of pixels is acquired in thevideo image.

In one embodiment, said flicker frame is produced from said photo imagewith the steps comprising: a) obtaining a brightness value for eachpixel in said photo image; b) quantizing said brightness value of eachpixel in said photo image; c) assigning a dark level value of “1” to thepixels on each row of the image that are bounded by a first pixel and asecond pixel, wherein the quantized value of said first pixel is smallerthan its preceding pixel in the same row and the quantized value of saidsecond pixel is smaller than its succeeding pixel in the same row, andfurther wherein the quantized value of said first and second pixels aregreater than the minimum of quantized value for all pixels in said photoimage; d) assigning a white level value of “1” to the pixels on each rowof the image that are bounded by a first pixel and a second pixel,wherein the quantized value of said first pixel is larger than itspreceding pixel in the same row and the quantized value of said secondpixel is larger than its succeeding pixel in the same row, and furtherwherein the quantized value of said first and second pixels are lessthan the maximum of quantized value for all pixels in said photo image;e) assigning a column output value of “1” to each column of pixels insaid photo image wherein each of said column has more pixels assignedwith dark level value “1” than pixels assigned with white level value“1”; f) assigning a column output value of “0” to each column of pixelsin said photo image wherein each of said column has less or same numberof pixels assigned with dark level value “1” compared to pixels assignedwith white level value “1”; and g) assembling a flicker frame by drawingeach of said column of pixels where its column output value is “1” inthe order each corresponding column of pixels is acquired in the photoimage. In another embodiment, said brightness value is obtained by theformula: Brightness, B_(x,y)=0.299r+0.587g+0.114 b wherein r, g and bare the red, green and blue value of the pixel respectively. In afurther embodiment, said quantized value Q(B_(x,y)) is obtained by theformula:

${Q\left( B_{x,y} \right)} = \frac{B_{x,y}}{\left( {255\text{/}q} \right)}$wherein q is a quantization parameter.

In one embodiment, a value for percent flicker is calculated by thesteps comprising: a) determining a minimum brightness value from allpixels that have (i) a dark level value of “1” and (ii) a quantizedvalue greater than the minimum of the quantized value for all pixels insaid photo image; b) determining a maximum brightness value from allpixels that have (i) a white level value of “1” and (ii) a quantizedvalue less than the maximum of the quantized value for all pixels insaid photo image; and c) calculating the percent flicker as:

$\frac{{{maximum}\mspace{14mu}{brightness}} - {{minimum}\mspace{14mu}{brightness}}}{{{maximum}\mspace{14mu}{brightness}} + {{minimum}\mspace{14mu}{brightness}}}.$

In one embodiment, said order of flicker frequency is calculated by thesteps comprising: a) determining a thickness value of each flicker darkline in said flicker frame by summing the number of columns between astarting column and an ending column, wherein all columns between saidstarting column and said ending column inclusively have column outputvalue of 1; and b) computing an order of flicker frequency by summing upthe number of flicker dark lines above a threshold value, wherein saidthreshold value is T×maximum thickness of all flicker dark lines, and Tis a threshold parameter between 0 and 1.

In one embodiment, said order of flicker index is calculated by thesteps comprising: a) determining a thickness value of each flicker darkline in said flicker frame by summing the number of columns between astarting column and an ending column, wherein all columns between saidstarting column and said ending column inclusively have column outputvalue of 1; b) computing an average thickness from all said thicknessvalues that are above a threshold, wherein said threshold is T×maximumthickness of all flicker dark lines, and T is a threshold parameterbetween 0 and 1; and c) computing an order of flicker index bynormalizing said average thickness with the width of the flicker frame.

In one embodiment, said image capturing device is a mobile deviceselected from the group consisting of a smart phone, a laptop computer,a tablet computer, and a digital camera.

In one embodiment, said light emitting source is an incandescent lightbulb, a compact fluorescent lamps, or a Light Emitting Diode lamps(LEDs).

In one embodiment, said method further comprises the step of storingsaid flicker-related parameters with the corresponding image or video ina database. In another embodiment, said method further comprises thestep of comparing and ranking said flicker-related parameters.

In one embodiment, this invention provides a device for determiningflicker-related parameters of a light emitting source, comprising: a) animage capturing device that comprises rolling shutter for acquiring animage or video of said light emitting source; b) one or more processorsfor generating from a captured image (i) a flicker frame comprising oneor more flicker dark lines, and (ii) one or more flicker-relatedparameters from said flicker frame; and c) a memory for storing saidimage or video and said flicker-related parameters.

In one embodiment, said device further comprises one or more processorsfor refining said flicker frame by processing a video image.

In one embodiment, said flicker-related parameter is selected from thegroup consisting of percent flicker, order of flicker frequency, andorder of flicker index.

In one embodiment, said flicker dark lines are determined by said one ormore processors upon executing the steps comprising: a) obtaining abrightness value for each pixel in said captured image; b) obtaining aquantized value for each of said brightness value; c) assigning a darklevel value of “1” to pixels on each row of the image that are boundedby a first pixel and a second pixel, wherein the quantized value of saidfirst pixel is smaller than its preceding pixel in the same row and thequantized value of said second pixel is smaller than its succeedingpixel in the same row and further wherein the quantized value of saidfirst and second pixels are greater than the minimum of the quantizedvalue for all pixels in said captured image; d) assigning a white levelvalue of “1” to pixels on each row of the image that are bounded by afirst pixel and a second pixel, wherein the quantized value of saidfirst pixel is larger than its preceding pixel in the same row and thequantized value of said second pixel is larger than its succeeding pixelin the same row and further wherein the quantized value of said firstand second pixels are less than the maximum of quantized value for allpixels in said captured image; e) assigning a column output value of “1”to each column of pixels in said photo image wherein each of said columnhas more pixels assigned with dark level value “1” than pixels assignedwith white level value “1”; f) assigning a column output value of “0” toeach column of pixels in said captured image wherein each of said columnhas less or same number of pixels assigned with dark level value “1”compared to pixels assigned with white level value “1”; and g)assembling a flicker frame by drawing each of said column of pixelswhere its column output value is “1” in the order each correspondingcolumn of pixels is acquired in the captured image.

In one embodiment, said image capturing device is a smart phone, laptopcomputer, tablet computer, or a digital camera.

In one embodiment, this invention provides a non-transitorycomputer-readable medium with instructions stored thereon, that whenexecuted by a processor, perform the steps comprising: a) obtaining abrightness value for each pixel in a captured image; b) obtaining aquantized value for each of said brightness value; c) assigning a darklevel value of “1” to pixels on each row of the image that are boundedby a first pixel and a second pixel, wherein the quantized value of saidfirst pixel is smaller than its preceding pixel in the same row and thequantized value of said second pixel is smaller than its succeedingpixel in the same row and further wherein the quantized value of saidfirst and second pixels are greater than the minimum of the quantizedvalue for all pixels in said captured image; d) assigning a white levelvalue of “1” to pixels on each row of the image that are bounded by afirst pixel and a second pixel, wherein the quantized value of saidfirst pixel is larger than its preceding pixel in the same row and thequantized value of said second pixel is larger than its succeeding pixelin the same row and further wherein the quantized value of said firstand second pixels are less than the maximum of the quantized value forall pixels in said captured image; e) assigning a column output value of“1” to each column of pixels in said photo image wherein each of saidcolumn has more pixels assigned with dark level value “1” than pixelsassigned with white level value “1”; f) assigning a column output valueof “0” to each column of pixels where each such column has less or samenumber of pixels assigned with dark level value “1” compared to pixelsassigned with white level value “1”; and g) assembling a flicker frameby drawing each column of pixels where its column output value is “1” inthe order each corresponding column of pixels is acquired in thecaptured image.

Throughout this specification, unless the context requires otherwise,the word “comprise” or variations such as “comprises” or “comprising”,will be understood to imply the inclusion of a stated integer or groupof integers but not the exclusion of any other integer or group ofintegers. It is also noted that in this disclosure and particularly inthe claims and/or paragraphs, terms such as “comprises”, “comprised”,“comprising” and the like can have the meaning attributed to it in U.S.patent law; e.g., they can mean “includes”, “included”, “including”, andthe like; i.e. they allow for elements not explicitly recited.

Furthermore, throughout the specification and claims, unless the contextrequires otherwise, the word “include” or variations such as “includes”or “including”, will be understood to imply the inclusion of a statedinteger or group of integers but not the exclusion of any other integeror group of integers.

Other definitions for selected terms used herein may be found within thedetailed description of the invention and apply throughout. Unlessotherwise defined, all other technical terms used herein have the samemeaning as commonly understood to one of ordinary skill in the art towhich the invention belongs.

Throughout this application, various references or publications arecited. Disclosures of these references or publications in theirentireties are hereby incorporated by reference into this application inorder to more fully describe the state of the art to which thisinvention pertains.

Other aspects and advantages of the invention will be apparent to thoseskilled in the art from a review of the ensuing description.

BRIEF DESCRIPTION OF THE DRAWINGS

The above and other objects and features of the present invention willbecome apparent from the following description of the invention, whentaken in conjunction with the accompanying drawings, in which:

FIG. 1 shows an example of light flicker across time as illustrated bybrightness waveform.

FIG. 2 shows an example brightness waveform of insignificant lightflicker.

FIG. 3 shows the capture of individual rows over time using rollingshutter.

FIG. 4 shows the behavior of flicker brightness in photos captured byrolling shutter.

FIG. 5 shows flickers in photo captured by rolling shutter.

FIG. 6 shows the behavior of flickers with different flicker frequenciesin photos captured by rolling shutter.

FIGS. 7A-7B shows flickers with different frequencies in photos capturedby rolling shutter. (7A) Flickers with lower frequency appear with fewerthicker dark lines in the photo; (7B) Flickers with higher frequencyappear with more thinner dark lines in the photo.

FIGS. 8A-8B shows the brightness waveforms with different flickerindexes. (8A) Brightness waveform with lower flicker index; (8B)Brightness waveform with higher flicker index.

FIGS. 9A-9D shows the AC waveforms of two light bulbs and thecorresponding photos captured by rolling shutter. (9A) AC waveform ofLight Bulb A (lower flicker index); (9B) AC waveform of Light Bulb B(higher flicker index); (9C) Flicker photo of Light Bulb A; (9D) Flickerphoto of Light Bulb B.

FIG. 10 shows one embodiment of a system executing the methodologies andalgorithms described herein.

FIGS. 11A-11B shows (11A) an input photo and (11B) one embodiment of theoutput Flicker Frame from the Flicker Identifier described herein.

FIGS. 12A-12C shows an example of successive input frames and an outputFlicker Frame from the Noise Filter. (12A) Frame V_(n-1); (12B) FrameV_(n); (12C) Output flicker frame from the Noise Filter.

DETAILED DESCRIPTION OF THE INVENTION

The present invention is not to be limited in scope by any of thespecific embodiments described herein. The following embodiments arepresented for exemplification only.

Without wishing to be bound by theory, the inventors have discoveredthrough their trials, experimentations and research the task ofcharacterizing the behaviour of light flickers captured in photos orvideos by a mobile phone camera. This invention also includes algorithmsto analyse the flicker behaviour of a light emitting source by examininga photo(s) or video of said light emitting source to estimateflicker-related parameters such as flicker percentage, the order offlicker index and the order of flicker frequency. These values can beused to rank and compare which light emitting source such as a lightbulb is having more serious flicker problem. In addition, this inventionincludes a database for recording the results for later reference andcomparisons.

In a first aspect of the present invention there is provided a methodand an apparatus for measuring the flickers of light emitting sourcescomprising using at least one image capturing apparatus in mobiledevices wherein there is provided methodologies and algorithms in saidmobile devices to analyze the flickers in a one or more captured photosand in a one or more captured videos, wherein further said methodologiesand algorithms estimate metrics comprising the percent flicker, theorder of flicker index and the order of flicker frequency of said lightemitting sources.

In a first embodiment of the first aspect of the present invention thereis provided a method and an apparatus wherein said mobile devicescomprising smartphones, tablets, laptops, notebooks and computer deviceswith at least one image capturing apparatus.

In a second embodiment of the first aspect of the present inventionthere is provided a method and an apparatus wherein said at least oneimage capturing apparatus comprising at least one still photographycamera and at least one video camera and at least one camera can captureboth still photography and video.

In a third embodiment of the first aspect of the present invention thereis provided a method and an apparatus wherein said methodologies andalgorithms comprising modules of Noise Filter, Flicker Identifier,Flicker Analyzer and Database.

In one example of the third embodiment of the first aspect of thepresent invention there is provided a method and an apparatus whereinafter capturing said one or more video said one or more video is passedto the Noise Filter for eliminating motion noise and background noise toproduce the Flicker Frame, wherein further the Flicker Analyzer willanalyze the flickers from the Flicker Frame and compute metricsestimations of percent flicker, order of flicker index and order offlicker frequency wherein such metrics estimations are recorded in theDatabase for reference or comparison.

In another example of the third embodiment of the first aspect of thepresent invention there is provided a method and an apparatus whereinafter capturing said one or more photo the Flicker Identifier willcompute the Flicker Frame from said one or more photo, which will thenbe passed to the Flicker Analyzer, wherein further the Flicker Analyzerwill analyze the flickers from the Flicker Frame and compute metricsestimations of percent flicker, order of flicker index and order offlicker frequency wherein such metrics estimations are recorded in theDatabase for reference or comparison.

In a fourth embodiment of the first aspect of the present inventionthere is provided a method and an apparatus wherein said method isimplemented in hardware.

In a fifth embodiment of the first aspect of the present invention thereis provided a method and an apparatus wherein said method is implementedin software.

Behaviour of Light Flickers in Photos Captured from Mobile Phone Camera

Percent Flicker

Light flicker is a rapid and repeated change over time in the brightnessof light. FIG. 1 shows an example brightness waveform of a light flickeracross time. A widely adopted metric, prosed by IESNA lighting experts,defining light flicker is called percent flicker (also known aspercentage flicker or flicker percentage). The percent flicker takes themaximum and minimum values of brightness, shown in FIG. 1 as max andmin, and performs the following calculation:Percent Flicker=(max−min)/(max+min)×100%  Equation 1:

The larger the percent flicker, the more fluctuation in brightness, themore significant the flicker is. FIG. 2 shows an example waveform ofinsignificant flicker with little fluctuation, i.e. low percent flicker.

To minimize overall chip size and cost, most mobile phone cameras userolling shutters, which capture individual rows of an image one by oneat different time as shown in FIG. 3.

Combining the brightness waveform of light flicker as shown in FIG. 1and the capture time of individual rows as shown in FIG. 3, thebehaviour of flickers can be explained using FIG. 4.

In FIG. 4, it can be seen that as the rolling shutter capturesindividual rows at different time while the brightness is changing, rowscaptured under higher brightness (e.g. rows 2, 3, 4) will appear asbright lines in the photo while rows captured under lower brightness(e.g. rows 5, 6, 7) will appear as dark lines in the photo (see anexample shown in FIG. 5).

From the above analysis, one can estimate the percent flicker of a lightemitting source (such as a light bulb) by getting the maximum brightnessof the bright lines and the minimum brightness of the dark lines fromthe photo of a light bulb captured by a rolling shutter (e.g. mobilephone camera). This is an estimation because due to the capture time,rolling shutter speed and flicker frequency, it may not be able tocapture the max and min values that are used in Equation 1 forcalculating the percent flicker. Also, the brightness in the photo maybe affected by factors like background, other light source in theenvironment, etc. which may not be the same as the true brightnessemitted from the bulb.

Due to the limitation of mobile phone cameras, the exact percent flickercannot be measured. However, this invention describes methodology andalgorithms to eliminate noise from photos of a light emitting source(such as a light bulb) captured with camera using rolling shutter (e.g.a mobile phone camera) and obtain an estimation of percent flicker thatwould give the same ranking order as the values obtained fromprofessional equipment in the laboratory, thus providing handy solutionfor users to do comparisons on different light emitting sources.

Flicker Frequency

Another metrics measuring the flicker problem is the flicker frequency.Studies have shown that different flicker frequencies cause differentbiological effects: visible flickers at frequencies ranging from 3 Hz to70 Hz would cause biological effects like epileptic seizures; invisibleflickers ranging from 70 Hz to 165 Hz would cause biological effectslike headaches and eye-strain; while biological effects from flickers atfrequencies above 165 Hz are negligible.

Some common methods are used to drive light bulbs to operate atfrequency twice the AC line frequency. Ideally, the brightness of a bulbis proportional to the current through it. This causes 100 Hz flickerfor a 50 Hz mains frequency in North America or 120 Hz flicker for a 60Hz mains frequency in Europe. But due to factors like driver circuitdesign, variations in manufacturing, bulbs age, malfunction, etc., bulbsmay produce flickers at various frequencies.

Combining the capture time of individual rows as shown in FIG. 3 andflickers with different flicker frequencies, the behaviour of flickerscan be explained using FIG. 6.

From FIG. 6, it can be seen that the lower the flicker frequency, themore number of continuous rows with low brightness will be captured,that is the dark lines in the photo would be thicker. But within thesame time, the lower the flicker frequency, the fewer dark lines wouldresult in the photo. Two examples are shown in FIG. 7.

From the above analysis, the number of dark lines in the photo wouldhelp us estimate the order of the flicker frequency. Due to thelimitation of mobile phone cameras, we cannot measure the exact value ofthe flicker frequency. Also, we are not going to estimate the flickerfrequency because that may depend on the rolling shutter speed, whichmay not be known or may vary across different mobile devices. Instead,this invention is going to estimate the order of the flickerfrequencies, which is sufficient for users to do comparisons. Thisestimation is independent of the rolling shutter speed as long as theflickers to be compared are captured with the same mobile device.

Flicker Index

Although most of the light bulbs operate at frequency twice the AC linefrequency, some bulbs stay bright for a longer time in a cycle whilesome bulbs drop in brightness gradually in a cycle. The faster thebrightness transition from the maximum value to the minimum value, themore severe the flickering is. Flicker index takes into account thistransition by the following calculation:

$\begin{matrix}\begin{matrix}{{{Flicker}\mspace{14mu}{Index}} = {{Area}\mspace{14mu}{above}\mspace{14mu}{Mean}\text{/}{Total}\mspace{14mu}{Area}}} \\{= {{area}\mspace{14mu} 1\text{/}\left( {{{area}\mspace{14mu} 1} + {{area}\mspace{14mu} 2}} \right)}}\end{matrix} & {{Equation}\mspace{14mu} 2}\end{matrix}$

where area 1 and area 2 are shown in FIG. 8.

Light sources with different flicker indexes also have differentbehaviours in photos captured by rolling shutter. Two examples are shownin FIG. 9. The two light bulbs shown in FIG. 9 both have flickerfrequency of 100 Hz. It can be seen that Light Bulb A stays bright for ashorter time in a cycle and brightness drops more gradually than LightBulb B (i.e. Light Bulb A is having lower flicker index than Light BulbB). The gradual drop in brightness is shown as thicker dark lines in thephoto (while the darkness of the flicker lines is related to the percentflicker of the light bulb).

From the above analysis, we can estimate the order of flicker indexes bycalculating the thickness of the dark lines in the photo. This is anestimation because due to the limitation of mobile phone cameras, wecannot measure the exact max and min values or the cycle time that areused in Equation 2 for calculating the flicker index.

Summarizing the above analysis, we can estimate the metrics percentflicker, the order of flicker index and the order of flicker frequencyby analysing the brightness, thickness and the number of dark lines inthe photos captured by rolling shutter. Again, accuracy of theestimations may be affected by factors like background, other lightsource in the environment, etc. This invention further describesmethodology and algorithms to eliminate such noise from the photos andperform estimations, which can give the same ranking order as the valuesobtained from professional equipment in the laboratory, thus providinghandy comparisons to users.

Methodology and Algorithm

FIG. 10 shows one embodiment of the present invention, which composes ofa Noise Filter, Flicker Identifier, Flicker Analyzer and a Database.After taking a video of a light source such as a light bulb from animage capturing device with rolling shutter (such as a mobile phonecamera), the video is passed to the Noise Filter to eliminate motion andbackground noise, and to produce the Flicker Frame. The Flicker Analyzerwill then analyze the flickers from the Flicker Frame and computeestimations of percent flicker, order of flicker index and order offlicker frequency. With a single photo of light bulb, the Flicker Framewill be computed by the Flicker Identifier and then passed to theFlicker Analyzer. After that, the video/photo together with the resultswill be recorded in the Database for later reference or comparison.

Flicker Identifier

In one embodiment, the Flicker Identifier identifies the flicker darklines in the photo and produces the Flicker Frame by the followingalgorithm:

Algorithm for identifying flicker dark lines from a photo: 1. For everypixel (x, y), obtain the brightness B_(x,y) by the following formula:B_(x,y) = 0.299r + 0.587g + 0.114b where r, g, b are the red, green andblue value of the pixel 2. Quantize the value of brightness B_(x,y) bythe following formula: Q(B_(x,y)) = └ B_(x,y) / (255 / q) ┘ where q isthe quantization parameter 3. For every row¹ y, - set dark leveld_(x, y) = 1 if Q_(low)_start ≦ x ≦ Q_(low)_end , and Q(B_(x,y)) >minimum of Q(B_(x,y)) ∀x, y, where Q_(low)_start = x if Q(B_(x,y)) <Q(B_(x−1,y)) and Q_(low)_end = x if Q(B_(x,y)) < Q(B_(x+1,y)) - setwhite level w_(x, y) = 1 if Q_(high)_start ≦ x ≦ Q_(high)_end , andQ(B_(x,y)) < maximum of Q(B_(x,y)) ∀x, y, where Q_(high)_start = x ifQ(B_(x,y)) > Q(B_(x−1,y)) and Q_(high)_end = x if Q(B_(x,y)) >Q(B_(x+1,y)) 4. For every column ² x, set column output c_(x) = 1 ifΣ_(y=0) ^(image)_height−1 d_(x,y) > Σ_(y=0) ^(image)_height−1w_(x,y),otherwise set c_(x) = 0 ¹In this invention, row means the lines ofpixels that are perpendicular to the flicker dark lines in the photo. ²In this invention, column means the lines of pixels that are parallel tothe flicker dark lines in the photo.

FIG. 11 shows an input photo of a light bulb and the output FlickerFrame from the Flicker Identifier, from which it can be seen thatbackground noise can be eliminated and the flicker dark lines can beidentified from the photo.

Flicker Analyzer

In one embodiment, the Flicker Analyzer estimates the percent flicker,the order of flicker index and the order of flicker frequency by thefollowing algorithms:

Algorithm for estimating the percent flicker: 1. Among all pixels (dx,dy) where d_(dx, dy) = 1 and Q(B_(dx,) _(dy)) > minimum of Q(B_(x,y))∀x, y, find the minimum brightness min_(Bdx,dy) from the input photo 2.Among all pixels (wx, wy) where w_(wx, wy) = 1 and Q(B_(wx,) _(wy)) <maximum of Q(B_(x,y)) ∀x, y, find the maximum brightness max_(Bwx,wy)from the input photo 3. Calculate the percent flicker estimation as:percent flicker estimation: f_(percent) = (max_(Bwx,wy) − min_(Bdx,dy))/ (max_(Bwx,wy) + min_(Bdx,dy))

Algorithm for estimating the order of flicker frequency and the order offlicker index: 1. Let F be the set of (i, j) where i, j∈ [0,image_width), j > i, c_(i) = c_(j) = 1, and c_(x) = c_(x+1) = 1 ∀x∈[i,j), find the thickness of a flicker dark line t_(i, j) = Σ_(x=i)^(j)c_(x) for all (i, j) ∈ F 2. Let F^(T) be the set of (i, j) where (i,j) ∈ F and t_(i, j) > T × maximum of t_(i, j) ∀(i, j) ∈ F, where T ∈(0, 1) is the valid threshold, estimate the order of flicker frequency:f_freq = | F^(T) |  and flicker index: f_idx = Σ_((i,j) ∈F) _(T) t_(i,j)/ | F^(T) |  / image_width

The range of percent flicker estimation f_(percent) is in [0, 1] wherethe larger the f_(percent), the more fluctuation in brightness, and themore significant the flicker is. The estimation of the order of flickerfrequency f_freq gives a value for relative comparison where the smallerthe f_freq, the lower the flicker frequency, and the more biologicaleffects the flicker would cause. The estimation of the order of flickerindex f_idx gives a value for relative comparison where the larger thef_idx, the lower the flicker index, the less severe the flickering is.

Noise Filter

Accuracy of the Flicker Analyzer depends on how the flicker dark linesin the Flicker Frame are reflecting the flicker dark lines in the inputphoto. In single-frame analysis, approximation of the flicker dark linesmay be affected by the background noise of the input photo. Or if thepercent flicker is low, the flicker lines in the photo may not be darkenough to be identified, thus affecting the accuracy of the estimations,an example is shown in FIG. 12(A).

To improve accuracy, the present invention provides a video analysis.However, motion noise may be introduced to the video if the user hashand shaking while taking the video. In one embodiment, with a video ofa light bulb from the mobile phone camera, the Noise Filter firstextracts two successive frames from the video which are having the leastmotion noise, and then produces the flicker frame by eliminatingbackground noise, with the following algorithm:

Algorithm for eliminating motion and background noise from the video andproducing the Flicker Frame: Let V_(n)(x, y) be pixel (x, y) from framen of a video V, 1. Compute the difference between V_(n) and V_(n−1):D_(n, n−1) = Σ_(∀(x,y))V_(n)(x,y) − V_(n−1)(x,y) 2. Compute thedifference frame V_(D) _(n,n−1) from any two successive frames V_(n) andV_(n−1) where D_(n, n−1) is minimum for all n > 0, where V_(D) _(n,n−1)(x,y) = V_(n)(x,y) − V_(n−1)(x,y) 3. For every column x, set columnoutput c_(x) = 1 if |V_(D) _(n,n−1) (x,y) < 0| > |V_(D) _(n,n−1) (x,y) >0|, otherwise set c_(x) = 0

FIG. 12 shows two successive frames extracted from the video of a lightbulb and the output Flicker Frame from the Noise Filter, from which itcan be seen that background noise can be eliminated and the flicker darklines can be identified even the percent flicker of the light bulb islow and the flicker lines are not very visible.

Database

In one embodiment, the database records the video/photo together withthe results (percent flicker estimation f_(percent), order of flickerfrequency f_freq, and order of flicker index f_idx) for later referenceand comparison.

Results and Discussions

Estimation of the Order of Flicker Frequency f_Freq

Since flickers with frequencies below 70 Hz is said to be visible tohuman while invisible flickers ranging from 70 Hz to 165 Hz would causevarious biological effects but biological effects from flickers atfrequencies above 165 Hz are negligible, we focus our experiments in theinvisible frequency range 70 Hz-220 Hz to see whether this invention isable to identify which light bulb has higher flicker frequency thatwould cause less significant biological effects. The following tableshows the results of photo analysis and video analysis of 9 samples withvarious flicker frequencies:

Photo Analysis Video Analysis Flicker Interpretation InterpretationSample Frequency f_freq of f_freq f_freq of f_freq F1 80 2  60-90 Hz 2 60-90 Hz F2 100 3  90-120 Hz 3 90-120 Hz F3 100 3  90-120 Hz 3 90-120Hz F4 100 3  90-120 Hz 3 90-120 Hz F5 110 3  90-120 Hz 3 90-120 Hz F6120 4 120-150 Hz 0 X F7 150 5 150-180 Hz 0 X F8 190 6 180-210 Hz 6180-210 Hz  F9 220 7 210-240 Hz 7 210-240 Hz 

From the results, it can be seen that the estimation of the order offlicker frequency f_freq can be used to identify flicker frequencies indifferent ranges. However, since the frame rate of taking video with amobile phone camera is 30 frames per second, flickers with frequenciesat multiple of 30 Hz (Sample F6 and F7) may appear as quite steady inthe videos, making the video analysis not applicable. This is alimitation due to the mobile phone camera setting. In those cases,estimation can be obtained by photo analysis.

Another experiment is to use laboratory equipment to operate Sample F9at various flicker frequencies. The following table shows the estimationf_freq from photo analysis and video analysis as well as the estimationof the thickness of the flicker dark lines in the photos or videos.

Photo Analysis Video Analysis Thickness Thickness Flicker Interpretationof flicker Interpretation of flicker Frequency f_freq of f_freq darklines f_freq of f_freq dark lines 80 2 60-90 Hz 524 2 60-90 Hz 311 90 3 90-120 Hz 452 not applicable 100 3  90-120 Hz 384 3  90-120 Hz 287 1103  90-120 Hz 359 3  90-120 Hz 241 120 4 120-150 Hz 341 not applicable130 4 120-150 Hz 297 4 120-150 Hz 212 140 4 120-150 Hz 281 4 120-150 Hz187 150 4 120-150 Hz 257 not applicable 160 5 150-180 Hz 245 5 150-180Hz 167 170 5 150-180 Hz 230 5 150-180 Hz 154 180 6 180-210 Hz 227 notapplicable 190 6 180-210 Hz 224 6 180-210 Hz 138 200 7 210-240 Hz 217 6180-210 Hz 132 210 7 210-240 Hz 200 not applicable 220 7 210-240 Hz 1777 210-240 Hz 89

From the results, we can see that although the estimation f_freq onlytells the flicker frequency range, we can use the thickness of theflicker dark lines to arrange the order of the flicker frequencies asthe thickness decreases with the frequency (as described in[0039-0044]). This means that this invention can be used to checkwhether a light bulb degrades (changing from a higher flicker frequencyto a lower flicker frequency) as it ages. However, only the thickness ofthe flicker dark lines cannot be used to estimate the order of differentflicker frequencies of different light bulbs as the thickness of flickerdark lines is also affected by the flicker index of the light bulb.

Estimation of the Order of Flicker Index f_idx

As described in [0045-0048], the lower the flicker index, the higher theestimation f_idx. The following table shows the results of photoanalysis and video analysis of 11 samples with various flicker indexes:

Photo Video Flicker Analysis Analysis Sample Index f_idx f_idx Remark I1No 0.042708 0 Flicker lines Flicker cannot be I2 No 0.076388 0identified in Flicker the photos. I3 0.33333 0.248148 0.316203 I40.35000 0.153867 0.269444 Result of photo analysis is affected bybackground noise information. I5 0.36538 0.208796 0.244907 I6 0.431810.054166 0.205555 Flicker lines cannot be identified in the photos. I70.43870 0.201252 0.184259 I8 0.44696 0.158333 0.164583 I9 0.451170.113153 0.148456 I10 0.46000 0.071370 0.077314 I11 0.46000 0.0614100.056018

The results show that this invention is able to identify light bulbswith different flicker index and arrange their order according to theestimation f_idx. However, as shown in Sample I4, it is possible thatresult of photo analysis may be affected by background noise informationin the photo. Another limitation is shown in Sample I6, which is havinglow percent flicker producing relatively bright flicker dark lines inthe photo, which cannot be identified, but video analysis can be used toobtain estimation in this case.

Estimation of Percent Flicker f_(percent)

The following table shows the results of photo analysis and videoanalysis of 11 samples with various percent flicker:

Photo Video Percent Analysis Analysis Sample Flicker f_(percent)f_(percent) Remark P1 No Flicker 0.770833 0 Result of photo P2 NoFlicker 0.722973 0 analysis is affected by background noise information.P3 0.12958 0.770833 0.770833 P4 0.13812 0.770833 0.770833 P5 0.225410.821429 0.814946 P6 0.23404 0.821429 0.821429 P7 0.26961 0.8214290.821429 P8 0.62617 0.954023 0.881919 P9 0.86192 0.992188 0.954023 P100.90244 0.994946 0.997407 P11 1.00000 0.995216 0.998621The results show that this invention is able to identify light bulbswith different percent flicker and arrange their order according to theestimation f_(percent). However, as shown in Samples P1 and P2, it ispossible that result of photo analysis may be affected by backgroundnoise information in the photo.

CONCLUSION

This invention examines the behaviour of light flickers of a lightsource captured in photos or videos by a camera with rolling shutter(such as mobile phone camera), and provides methodology and algorithmsto analyse the flicker-related parameters such as the percent flicker,the order of flicker index and the order of flicker frequency. Due tothe limitation of mobile phone camera, the exact values cannot bemeasured, but experiments show that the estimations obtained from thisinvention match with the ranking order of values obtained from thelaboratory. Hence, this invention provides a handy solution for users tocompare the flicker problem of different light sources.

In estimating the order of flicker frequency, due to the limitation ofmobile phone camera setting, video analysis may not work for frequenciesat multiple of 30 Hz, but estimations can still be obtained from photoanalysis. Another limitation is the Flicker Identifier of the photoanalysis: accuracy may be affected by background noise information inthe photo, or it may not be able to identify the relatively brightflicker lines from a single photo produced by light sources with lowpercent flicker, but estimations can be obtained from video analysis inthose cases. Furthermore, it is known to a person skilled in the artthat should the frame capture rate of the mobile device be higher, thepresent invention can be applied to analyze light sources with flickerfrequencies. Embodiments of the present invention provided herein aremerely limited by the hardware parameters of the mobile devices used andnot the underlying inventive algorithms and inventions therein.

The present invention discloses a method of measuring the flickers oflight emitting sources using image capturing apparatus in mobiledevices. In one embodiment, the present invention relates to a method ofmeasuring the flickers of light emitting sources using image capturingapparatus in mobile devices for quality checking and quality control ofsaid light emitting sources.

If desired, the different functions discussed herein may be performed ina different order and/or concurrently with each other. Furthermore, ifdesired, one or more of the above-described functions may be optional ormay be combined.

In one embodiment, this invention provides a method of determiningflicker-related parameters of a light emitting source, comprising thesteps of: a) acquiring one or more photo images or video images of alight emitting source with an image capturing device that comprisesrolling shutter; b) generating, with a processor, from said photo imagesor video images a flicker frame comprising one or more flicker darklines, wherein each flicker dark lines has an output column value of 1;and c) generating, with a processor, one or more flicker-relatedparameters based on said flicker frame, thereby determining theflicker-related parameters of said light emitting source.

In one embodiment, said flicker-related parameters are selected from thegroup consisting of percent flicker, order of flicker frequency, andorder of flicker index.

In one embodiment, said flicker frame is produced from said video imagesby the steps comprising: a) determining the sum of the differences inpixel values between corresponding pixels in successive frames of thevideo image, wherein any two successive frames, a first frame and asecond frame, that have the smallest difference are the frames that havethe least motion noise; b) subtracting the pixel value of each pixel onsaid first frame from the pixel value of the corresponding pixel on saidsecond frame to obtain changes in pixel values over time; c) assigning acolumn output value of “1” to each column of pixels in said video imagewherein in each of said column, the number of pixels having decreasedpixel value over time is more than the sum of the number of pixelshaving increased pixel value over time; d) assigning a column outputvalue of “0” to each columns of pixels in said video image wherein ineach of said column, the number of pixels having decreased pixel valueover time is not more than the sum of the number of pixels havingincreased pixel value over time and the number of pixels having nochange in pixel value over time; and e) assembling a flicker frame bydrawing each of said column of pixels where its column output value is“1” in the order each corresponding column of pixels is acquired in thevideo image.

In one embodiment, said flicker frame is produced from said photo imagewith the steps comprising: a) obtaining a brightness value for eachpixel in said photo image; b) quantizing said brightness value of eachpixel in said photo image; c) assigning a dark level value of “1” to thepixels on each row of the image that are bounded by a first pixel and asecond pixel, wherein the quantized value of said first pixel is smallerthan its preceding pixel in the same row and the quantized value of saidsecond pixel is smaller than its succeeding pixel in the same row, andfurther wherein the quantized value of said first and second pixels aregreater than the minimum of quantized value for all pixels in said photoimage; d) assigning a white level value of “1” to the pixels on each rowof the image that are bounded by a first pixel and a second pixel,wherein the quantized value of said first pixel is larger than itspreceding pixel in the same row and the quantized value of said secondpixel is larger than its succeeding pixel in the same row, and furtherwherein the quantized value of said first and second pixels are lessthan the maximum of quantized value for all pixels in said photo image;e) assigning a column output value of “1” to each column of pixels insaid photo image wherein each of said column has more pixels assignedwith dark level value “1” than pixels assigned with white level value“1”; f) assigning a column output value of “0” to each column of pixelsin said photo image wherein each of said column has less or same numberof pixels assigned with dark level value “1” compared to pixels assignedwith white level value “1”; and g) assembling a flicker frame by drawingeach of said column of pixels where its column output value is “1” inthe order each corresponding column of pixels is acquired in the photoimage. In another embodiment, said brightness value is obtained by theformula: Brightness, B_(x,y), =0.299r+0.587g+0.114 b wherein r, g and bare the red, green and blue value of the pixel respectively. In afurther embodiment, said quantized value Q(B_(x,y)) is obtained by theformula:

${Q\left( B_{x,y} \right)} = \frac{B_{x,y}}{\left( {255\text{/}q} \right)}$wherein q is a quantization parameter.

In one embodiment, a value for percent flicker is calculated by thesteps comprising: a) determining a minimum brightness value from allpixels that have (i) a dark level value of “1” and (ii) a quantizedvalue greater than the minimum of the quantized value for all pixels insaid photo image; b) determining a maximum brightness value from allpixels that have (i) a white level value of “1” and (ii) a quantizedvalue less than the maximum of the quantized value for all pixels insaid photo image; and c) calculating the percent flicker as:

$\frac{{{maximum}\mspace{14mu}{brightness}} - {{minimum}\mspace{14mu}{brightness}}}{{{maximum}\mspace{14mu}{brightness}} + {{minimum}\mspace{14mu}{brightness}}}.$

In one embodiment, said order of flicker frequency is calculated by thesteps comprising: a) determining a thickness value of each flicker darkline in said flicker frame by summing the number of columns between astarting column and an ending column, wherein all columns between saidstarting column and said ending column inclusively have column outputvalue of 1; and b) computing an order of flicker frequency by summing upthe number of flicker dark lines above a threshold value, wherein saidthreshold value is T×maximum thickness of all flicker dark lines, and Tis a threshold parameter between 0 and 1.

In one embodiment, said order of flicker index is calculated by thesteps comprising: a) determining a thickness value of each flicker darkline in said flicker frame by summing the number of columns between astarting column and an ending column, wherein all columns between saidstarting column and said ending column inclusively have column outputvalue of 1; b) computing an average thickness from all said thicknessvalues that are above a threshold, wherein said threshold is T×maximumthickness of all flicker dark lines, and T is a threshold parameterbetween 0 and 1; and c) computing an order of flicker index bynormalizing said average thickness with the width of the flicker frame.

In one embodiment, said image capturing device is a mobile deviceselected from the group consisting of a smart phone, a laptop computer,a tablet computer, and a digital camera.

In one embodiment, said light emitting source is an incandescent lightbulb, a compact fluorescent lamps, or a Light Emitting Diode lamps(LEDs).

In one embodiment, said method further comprises the step of storingsaid flicker-related parameters with the corresponding image or video ina database. In another embodiment, said method further comprises thestep of comparing and ranking said flicker-related parameters.

In one embodiment, this invention provides a device for determiningflicker-related parameters of a light emitting source, comprising: a) animage capturing device that comprises rolling shutter for acquiring animage or video of said light emitting source; b) one or more processorsfor generating from a captured image (i) a flicker frame comprising oneor more flicker dark lines, and (ii) one or more flicker-relatedparameters from said flicker frame; and c) a memory for storing saidimage or video and said flicker-related parameters.

In one embodiment, said device further comprises one or more processorsfor refining said flicker frame by processing a video image.

In one embodiment, said flicker-related parameter is selected from thegroup consisting of percent flicker, order of flicker frequency, andorder of flicker index.

In one embodiment, said flicker dark lines are determined by said one ormore processors upon executing the steps comprising: a) obtaining abrightness value for each pixel in said captured image; b) obtaining aquantized value for each of said brightness value; c) assigning a darklevel value of “1” to pixels on each row of the image that are boundedby a first pixel and a second pixel, wherein the quantized value of saidfirst pixel is smaller than its preceding pixel in the same row and thequantized value of said second pixel is smaller than its succeedingpixel in the same row and further wherein the quantized value of saidfirst and second pixels are greater than the minimum of the quantizedvalue for all pixels in said captured image; d) assigning a white levelvalue of “1” to pixels on each row of the image that are bounded by afirst pixel and a second pixel, wherein the quantized value of saidfirst pixel is larger than its preceding pixel in the same row and thequantized value of said second pixel is larger than its succeeding pixelin the same row and further wherein the quantized value of said firstand second pixels are less than the maximum of quantized value for allpixels in said captured image; e) assigning a column output value of “1”to each column of pixels in said photo image wherein each of said columnhas more pixels assigned with dark level value “1” than pixels assignedwith white level value “1”; f) assigning a column output value of “0” toeach column of pixels in said captured image wherein each of said columnhas less or same number of pixels assigned with dark level value “1”compared to pixels assigned with white level value “1”; and g)assembling a flicker frame by drawing each of said column of pixelswhere its column output value is “1” in the order each correspondingcolumn of pixels is acquired in the captured image.

In one embodiment, said image capturing device is a smart phone, laptopcomputer, tablet computer, or a digital camera.

In one embodiment, this invention provides a non-transitorycomputer-readable medium with instructions stored thereon, that whenexecuted by a processor, perform the steps comprising: a) obtaining abrightness value for each pixel in a captured image; b) obtaining aquantized value for each of said brightness value; c) assigning a darklevel value of “1” to pixels on each row of the image that are boundedby a first pixel and a second pixel, wherein the quantized value of saidfirst pixel is smaller than its preceding pixel in the same row and thequantized value of said second pixel is smaller than its succeedingpixel in the same row and further wherein the quantized value of saidfirst and second pixels are greater than the minimum of the quantizedvalue for all pixels in said captured image; d) assigning a white levelvalue of “1” to pixels on each row of the image that are bounded by afirst pixel and a second pixel, wherein the quantized value of saidfirst pixel is larger than its preceding pixel in the same row and thequantized value of said second pixel is larger than its succeeding pixelin the same row and further wherein the quantized value of said firstand second pixels are less than the maximum of the quantized value forall pixels in said captured image; e) assigning a column output value of“1” to each column of pixels in said photo image wherein each of saidcolumn has more pixels assigned with dark level value “1” than pixelsassigned with white level value “1”; f) assigning a column output valueof “0” to each column of pixels where each such column has less or samenumber of pixels assigned with dark level value “1” compared to pixelsassigned with white level value “1”; and g) assembling a flicker frameby drawing each column of pixels where its column output value is “1” inthe order each corresponding column of pixels is acquired in thecaptured image.

While the foregoing invention has been described with respect to variousembodiments and examples, it is understood that other embodiments arewithin the scope of the present invention as expressed in the followingclaims and their equivalents. Moreover, the above specific examples areto be construed as merely illustrative, and not limitative of thereminder of the disclosure in any way whatsoever. Without furtherelaboration, it is believed that one skilled in the art can, based onthe description herein, utilize the present invention to its fullestextent. All publications recited herein are hereby incorporated byreference in their entirety.

What is claimed is:
 1. A method of determining flicker-relatedparameters of a light emitting source, comprising the steps of: (a)acquiring one or more video images of a light emitting source with animage capturing device that comprises rolling shutter; (b) generating,with a processor, from said video images a flicker frame comprising oneor more flicker dark lines, wherein each flicker dark lines has anoutput column value of 1; and (c) generating, with a processor, one ormore flicker-related parameters based on said flicker frame, therebydetermining the flicker-related parameters of said light emittingsource; wherein said flicker frame is produced from said video images bythe steps comprising: (a) determining the sum of the differences inpixel values between corresponding pixels in successive frames of thevideo images, wherein any two successive frames, a first frame and asecond frame, that have the smallest difference are the frames that havethe least motion noise; (b) subtracting the pixel value of each pixel onsaid first frame from the pixel value of the corresponding pixel on saidsecond frame to obtain changes in pixel values over time; (c) assigninga column output value of “1” to each column of pixels in said videoimages wherein in each of said column, the number of pixels havingdecreased pixel value over time is more than the sum of the number ofpixels having increased pixel value over time; (d) assigning a columnoutput value of “0” to each columns of pixels in said video imageswherein in each of said column, the number of pixels having decreasedpixel value over time is not more than the sum of the number of pixelshaving increased pixel value over time and the number of pixels havingno change in pixel value over time; and (e) assembling a flicker frameby drawing each of said column of pixels where its column output valueis “1” in the order each corresponding column of pixels is acquired inthe video images.
 2. The method of claim 1, wherein said flicker-relatedparameters are selected from the group consisting of percent flicker,order of flicker frequency, and order of flicker index.
 3. A method ofdetermining flicker-related parameters of a light emitting source,comprising the steps of: (a) acquiring one or more photo images of alight emitting source with an image capturing device that comprisesrolling shutter; (b) generating, with a processor, from said photoimages a flicker frame comprising one or more flicker dark lines,wherein each flicker dark lines has an output column value of 1; and (c)generating, with a processor, one or more flicker-related parametersbased on said flicker frame, thereby determining the flicker-relatedparameters of said light emitting source; wherein said flicker frame isproduced from said photo images with the steps comprising: (a) obtaininga brightness value for each pixel in said photo images; (b) quantizingsaid brightness value of each pixel in said photo images; (c) assigninga dark level value of “1” to the pixels on each row of the photo imagesthat are bounded by a first pixel and a second pixel, wherein thequantized value of said first pixel is smaller than its preceding pixelin the same row and the quantized value of said second pixel is smallerthan its succeeding pixel in the same row, and further wherein thequantized value of said first and second pixels are greater than theminimum of quantized value for all pixels in said photo images; (d)assigning a white level value of “1” to the pixels on each row of thephoto images that are bounded by a first pixel and a second pixel,wherein the quantized value of said first pixel is larger than itspreceding pixel in the same row and the quantized value of said secondpixel is larger than its succeeding pixel in the same row, and furtherwherein the quantized value of said first and second pixels are lessthan the maximum of quantized value for all pixels in said photo images;(e) assigning a column output value of “1” to each column of pixels insaid photo images wherein each of said column has more pixels assignedwith dark level value “1” than pixels assigned with white level value“1”; (f) assigning a column output value of “0” to each column of pixelsin said photo images wherein each of said column has less or same numberof pixels assigned with dark level value “1” compared to pixels assignedwith white level value “1”; and (g) assembling a flicker frame bydrawing each of said column of pixels where its column output value is“1” in the order each corresponding column of pixels is acquired in thephoto images.
 4. The method of claim 3, wherein said brightness value isobtained by the formula:Brightness, B _(x,y)=0.299r+0.587g+0.114b wherein r, g and b are thered, green and blue value of the pixel respectively.
 5. The method ofclaim 3, wherein said quantized value Q(B_(x,y)) is obtained by theformula:${Q\left( B_{x,y} \right)} = \frac{B_{x,y}}{\left( {255\text{/}q} \right)}$wherein q is a quantization parameter.
 6. The method of claim 3, whereina value for percent flicker is calculated by the steps comprising: (a)determining a minimum brightness value from all pixels that have (i) adark level value of “1” and (ii) a quantized value greater than theminimum of the quantized value for all pixels in said photo images; (b)determining a maximum brightness value from all pixels that have (i) awhite level value of “1” and (ii) a quantized value less than themaximum of the quantized value for all pixels in said photo images; and(c) calculating the percent flicker as:$\frac{{{maximum}\mspace{14mu}{brightness}} - {{minimum}\mspace{14mu}{brightness}}}{{{maximum}\mspace{14mu}{brightness}} + {{minimum}\mspace{14mu}{brightness}}}.$7. The method of claim 2, wherein said order of flicker frequency iscalculated by the steps comprising: (a) determining a thickness value ofeach flicker dark line in said flicker frame by summing the number ofcolumns between a starting column and an ending column, wherein allcolumns between said starting column and said ending column inclusivelyhave column output value of 1; and (b) computing an order of flickerfrequency by summing up the number of flicker dark lines above athreshold value, wherein said threshold value is T×maximum thickness ofall flicker dark lines, and T is a threshold parameter between 0 and 1.8. The method of claim 2, wherein said order of flicker index iscalculated by the steps comprising: (a) determining a thickness value ofeach flicker dark line in said flicker frame by summing the number ofcolumns between a starting column and an ending column, wherein allcolumns between said starting column and said ending column inclusivelyhave column output value of 1; (b) computing an average thickness fromall said thickness values that are above a threshold, wherein saidthreshold is T×maximum thickness of all flicker dark lines, and T is athreshold parameter between 0 and 1; and (c) computing an order offlicker index by normalizing said average thickness with the width ofthe flicker frame.
 9. The method of claim 1, wherein said imagecapturing device is a mobile device selected from the group consistingof a smart phone, a laptop computer, a tablet computer, and a digitalcamera.
 10. The method of claim 1, wherein said light emitting source isan incandescent light bulb, a compact fluorescent lamp, or a LightEmitting Diode lamps (LEDs).
 11. The method of claim 1, furthercomprising the step of storing said flicker-related parameters with thecorresponding image or video in a database.
 12. The method of claim 11,further comprising the step of comparing and ranking saidflicker-related parameters.
 13. A device for determining flicker-relatedparameters of a light emitting source, comprising: (a) an imagecapturing device that comprises rolling shutter for acquiring one ormore video images of said light emitting source; (b) one or moreprocessors for generating from said video images (i) a flicker framecomprising one or more flicker dark lines, and (ii) one or moreflicker-related parameters from said flicker frame; and (c) a memory forstoring said video images and said flicker-related parameters; whereinsaid flicker frame is produced from said video images by the stepscomprising: (a) determining the sum of the differences in pixel valuesbetween corresponding pixels in successive frames of the video images,wherein any two successive frames, a first frame and a second frame,that have the smallest difference are the frames that have the leastmotion noise; (b) subtracting the pixel value of each pixel on saidfirst frame from the pixel value of the corresponding pixel on saidsecond frame to obtain changes in pixel values over time; (c) assigninga column output value of “1” to each column of pixels in said videoimage wherein in each of said column, the number of pixels havingdecreased pixel value over time is more than the sum of the number ofpixels having increased pixel value over time; (d) assigning a columnoutput value of “0” to each columns of pixels in said video imagewherein in each of said column, the number of pixels having decreasedpixel value over time is not more than the sum of the number of pixelshaving increased pixel value over time and the number of pixels havingno change in pixel value over time; and (e) assembling a flicker frameby drawing each of said column of pixels where its column output valueis “1” in the order each corresponding column of pixels is acquired inthe video images.
 14. The device of claim 13, further comprises one ormore processors for refining said flicker frame by processing a video.15. The device of claim 13, wherein said flicker-related parameter isselected from the group consisting of percent flicker, order of flickerfrequency, and order of flicker index.
 16. The device of claim 13,wherein said image capturing device is a smart phone, laptop computer,tablet computer, or a digital camera.
 17. A non-transitorycomputer-readable medium with instructions stored thereon, that whenexecuted by a processor, perform the steps comprising: (a) obtaining abrightness value for each pixel in a captured image; (b) obtaining aquantized value for each of said brightness value; (c) assigning a darklevel value of “1” to pixels on each row of the captured image that arebounded by a first pixel and a second pixel, wherein the quantized valueof said first pixel is smaller than its preceding pixel in the same rowand the quantized value of said second pixel is smaller than itssucceeding pixel in the same row and further wherein the quantized valueof said first and second pixels are greater than the minimum of thequantized value for all pixels in said captured image; (d) assigning awhite level value of “1” to pixels on each row of the captured imagethat are bounded by a first pixel and a second pixel, wherein thequantized value of said first pixel is larger than its preceding pixelin the same row and the quantized value of said second pixel is largerthan its succeeding pixel in the same row and further wherein thequantized value of said first and second pixels are less than themaximum of the quantized value for all pixels in said captured image;(e) assigning a column output value of “1” to each column of pixels insaid captured image wherein each of said column has more pixels assignedwith dark level value “1” than pixels assigned with white level value“1”; (f) assigning a column output value of “0” to each column of pixelswhere each such column has less or same number of pixels assigned withdark level value “1” compared to pixels assigned with white level value“1”; and (g) assembling a flicker frame by drawing each column of pixelswhere its column output value is “1” in the order each correspondingcolumn of pixels is acquired in the captured image.
 18. A device fordetermining flicker-related parameters of a light emitting source,comprising: (a) an image capturing device that comprises rolling shutterfor acquiring one or more photo images of said light emitting source;(b) one or more processors for generating said photo images (i) aflicker frame comprising one or more flicker dark lines, and (ii) one ormore flicker-related parameters from said flicker frame; and (c) amemory for storing said photo images and said flicker-relatedparameters; wherein said flicker frame is produced from said photoimages with the steps comprising: (a) obtaining a brightness value foreach pixel in said photo images; (b) quantizing said brightness value ofeach pixel in said photo images; (c) assigning a dark level value of “1”to the pixels on each row of the photo images that are bounded by afirst pixel and a second pixel, wherein the quantized value of saidfirst pixel is smaller than its preceding pixel in the same row and thequantized value of said second pixel is smaller than its succeedingpixel in the same row, and further wherein the quantized value of saidfirst and second pixels are greater than the minimum of quantized valuefor all pixels in said photo images; (d) assigning a white level valueof “1” to the pixels on each row of the image that are bounded by afirst pixel and a second pixel, wherein the quantized value of saidfirst pixel is larger than its preceding pixel in the same row and thequantized value of said second pixel is larger than its succeeding pixelin the same row, and further wherein the quantized value of said firstand second pixels are less than the maximum of quantized value for allpixels in said photo images; (e) assigning a column output value of “1”to each column of pixels in said photo image wherein each of said columnhas more pixels assigned with dark level value “1” than pixels assignedwith white level value “1”; (f) assigning a column output value of “0”to each column of pixels in said photo image wherein each of said columnhas less or same number of pixels assigned with dark level value “1”compared to pixels assigned with white level value “1”; and (e)assembling a flicker frame by drawing each of said column of pixelswhere its column output value is “1” in the order each correspondingcolumn of pixels is acquired in the photo images.
 19. The device ofclaim 18, wherein said brightness value is obtained by the formula:Brightness, B _(x,y)=0.299r+0.587g+0.114b wherein r, g and b are thered, green and blue value of the pixel respectively.
 20. The device ofclaim 18, wherein said quantized value Q(B_(x,y)) is obtained by theformula:${Q\left( B_{x,y} \right)} = \frac{B_{x,y}}{\left( {255\text{/}q} \right)}$wherein q is a quantization parameter.